package com.honweek;

public class RunTest {
    public static void main(String[] args) {
            Tortoise tro = new Tortoise();
            Rabbit rab = new Rabbit();
            new Thread(tro).start();
            new Thread(rab).start();
    }
}

class Tortoise implements Runnable{
    @Override
    public void run() {
        for(int i =1; i<=30; i++){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("乌龟刘露露跑了一米=_=~~~~~~~~");
            if(i==30){
                System.out.println("乌龟刘露露终于趴到了终点！！！！鼓掌*********");
                break;
            }
            if(i%10==0){
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("乌龟露露累趴下了 加油!");
            }
        }
    }
}
class Rabbit implements Runnable{
    @Override
    public void run() {
        for(int i = 1; i<=30; i++) {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("男神刘帮亿向前飞翔了一米======^-^============");
             if(i==30){
                System.out.println("天哪！男神到达终点！！！！！！！!!!!!!!!!!!!!!!!!!!");
                break;
            }
             if(i%10==0){
                 try {
                     Thread.sleep(10000);
                 } catch (InterruptedException e) {
                     e.printStackTrace();
                 }
                 System.out.println("男神吃点水果等待乌龟露露");
             }
        }
    }
}


